<?php
include 'PHP/mysql.php';//连接到mysql页面
        $name = @$_POST['change_name'];
		$newpassword = @$_POST['newPWD'];
		if($newpassword != "" && $name != "")
		{
			$sq1 = "select * from user where number = '$name' ";
			$result = mysqli_query($link,$sq1);
			$row = mysqli_num_rows($result);
			if($row)
			{
				$sq2 =  "UPDATE `user` SET `password`= '".$newpassword."' WHERE number = '".$name."' ";
				$change_success = mysqli_query($link,$sq2);
				if($change_success)
				{
					echo "<script>
					alert('修改成功');
					location.href = 'Platform_service.html';
					</script>";
				}
				
			}
			else
			{
				echo "<script> alert('输入的用户名不存在') </script>";
			}
			
			
			
			
		}
		
	
	
 




?>